#include <stdio.h>
#include <stdlib.h>

typedef struct Node{
    int data;
    struct Node *next;
} Node;


Node *createNode(int data) {
    // 利用指针传递链表的同时增加了代码高效性，同时为防止局部变量无法传递需要用到malloc分配地址空间
    Node *node = (Node*)malloc(sizeof(Node)); 
    node->data = data;
    node->next = NULL;
    return node;
}

void printlink(Node *head){
    while (head!=NULL){
        printf("%d ",head->data);
        head = head->next;
    }
}

int main(){
    Node *head = createNode(23);
    Node *next = createNode(67);
    head->next = next;
    next->next = createNode(89);
    printlink(head);

    return 0;
}